<?php

/*
|--------------------------------------------------------------------------
| Web Routes
|--------------------------------------------------------------------------
|
| Here is where you can register web routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| contains the "web" middleware group. Now create something great!
|
*/

Route::get('/', "Home\IndexController@index");

Route::group(['prefix'=>'admin','namespace'=>'Admin'],function(){
//    Route::get('login', 'Auth\LoginController@showLoginForm')->name('login');
//    Route::post('login', 'Auth\LoginController@login');
//    Route::post('logout', 'Auth\LoginController@logout')->name('logout');

    Route::any("login","Auth\LoginController@index");//后台登录

    Route::get("email","Auth\ForgotPasswordController@showLinkRequestForm");//忘记密码--填写邮箱显示页
    Route::post("email","Auth\ForgotPasswordController@sendResetLinkEmail");//填写邮箱--提交

    Route::get("reset/{token}","Auth\ResetPasswordController@showResetForm");//重置密码显示页
    Route::post("reset","Auth\ResetPasswordController@reset");//重置密码--提交

    Route::group(['middleware'=>'admin.auth'],function (){
        Route::get('/','IndexController@index');//后台首页
        Route::get('welcome','IndexController@welcome');//后台首页
        Route::get('logout','Auth\LoginController@logout');//后台退出
        Route::resource('picture','PictureController');//图片管理

        Route::post('delete','NewsController@batch_delete');//文章列表批量删除
        Route::post('sou','NewsController@search');//文章搜索
        Route::resource('article','NewsController');//文章列表
        Route::resource('classify','ClassifyController');//栏目管理

        Route::get('system','SystemController@index');//系统管理
        Route::post('system','SystemController@store');//系统管理表单提交
        Route::resource('administration','AdministrationController');//管理员管理

        Route::resource('adv','AdvController');//广告管理
        Route::resource('billboard','BillboardController');//广告列表

        Route::resource('sceify','SceifyController');//基地管理--分类列表
        Route::any('search','SpotController@search');//基地管理--基地列表--搜索基地
        Route::resource('spot','SpotController');//基地管理--审核成功基地详情内容列表
        Route::resource('not','NotSpotController');//基地管理--待审核基地详情内容列表
        Route::resource('examine','ExamineController');//基地管理--待审核基地列表
        Route::resource('success-base','SuccessBaseController');//基地管理--审核成功基地列表

        Route::resource('handle','HandleController',['only' => [
            'index','store','show','update'
        ]]);//承办机构管理--待审核承办机构
        Route::resource('success-mechanism','SuccessMechanismController',['only' => [
            'index','show','destroy'
        ]]);//承办机构管理--审核成功承办机构
        Route::resource('travels', 'TravelsController', ['only' => [   //资讯管理--游记列表
            'index', 'show' , 'destroy'
        ]]);

        Route::resource('campus','CampusController');//非遗专区--非遗进校园
        Route::get('form','FormController');//非遗专区--预约列表

        Route::post('search-problem','TopicsController@search');//评论管理---问题列表--搜索问题
        Route::resource('topics', 'TopicsController', ['only' => ['index', 'show', 'destroy']]);//评论管理---问题列表
        Route::resource('replies', 'RepliesController', ['only' => ['index', 'show', 'create', 'store', 'update', 'edit', 'destroy']]);//评论管理---问题列表--回复

        Route::resource('user','UserController');//用户管理---用户列表
    });
});



